<?php
class WeishopModel extends Model
{
	private $_obj = null;

	public function __construct()
	{
		if($this->_obj == null){
			$this->_obj = M('Weishop');
		}
	}

	public function getShopDetail($options)
	{
		return $this->_obj->where($options)->find();
	}

	public function getShopListAll($order = array())
	{
		return $this->_obj->order($order)->select();
	}

	public function getShopList($page, $page_size, $options=array(), $order)
	{
		return $this->_obj->where($options)->limit($page, $page_size)->order($order)->select();
	}

	public function getShopCount($options = array())
	{
		return $this->_obj->where($options)->count();
	}

	public function addShop($params)
	{
		return $this->_obj->add($params);
	}

	public function updateShop($options, $data)
	{
		return $this->_obj->where($options)->save($data);
	}

	public function delShop($options)
	{
		return $this->_obj->where($options)->delete();
	}
}